class LinearEquation:
    def __init__(self,a,b,c,d,e,f):
        self.__a = a
        self.__b = b
        self.__c = c
        self.__d = d
        self.__e = e
        self.__f = f

    def solvable(self):
        return self.__a*self.__d - self.__b*self.__c

    def isSolvable(self):
        return self.solvable() != 0

    def getX(self):
        if self.isSolvable():
            return str((self.__e * self.__d - self.__b*self.__f) / self.solvable())
        else:
            return "error"

    def getY(self):
        if self.isSolvable():
            return str((self.__a * self.__f - self.__e*self.__c) / self.solvable())
        else:
            return "error"

def main():
    line = LinearEquation(9.0,4.0,3.0,-5.0,-6.0,-21.0)
    if line.isSolvable():
        print("x is ", line.getX(), ",y is ", line.getY())
    else:
        print("此方程无解")


main()